'''
Created on Mar 3, 2016

@author: JimmyMo
'''
import time
import inspect
class Reader(object):
    def __init__(self):
        self._parse_options()
        pass
    def set_successor(self, successor):
        self.successor = successor
        return successor
    
    def read(self):
        real_class_name =  self.__class__.__name__
        now = time.clock()
        time.clock()
        logs = self._read()
        elapsed = time.clock() - now
        print("%s reading took %fs" % (real_class_name, elapsed))
        return logs
    
    def _parse_options(self):
        '''abstract method'''
        class_name = self.__class__.__name__
        method_name = inspect.stack()[0][3]
        raise Exception("%s method in class %s is abstract method which is not implemented..." % (method_name, class_name))
        
    def _read(self):
        '''abstract method'''
        class_name = self.__class__.__name__
        method_name = inspect.stack()[0][3]
        raise Exception("%s method in class %s is abstract method which is not implemented..." % (method_name, class_name))
